package com.caigou.modules.center.adapter

import android.view.View
import com.caigou.modules.center.R
import com.caigou.modules.center.bean.FlowerItemBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author #Suyghur.
 * Created on 2021/11/03
 */
class FlowerAdapter(dataset: MutableList<FlowerItemBean>) : BaseQuickAdapter<FlowerItemBean, BaseViewHolder>(R.layout.item_flower_list, dataset),
    LoadMoreModule {
    override fun convert(holder: BaseViewHolder, item: FlowerItemBean) {
        holder.setText(R.id.item_flower_tv_num, "+${item.num}")
        holder.setText(R.id.item_flower_tv_task_desc, item.operateRemark)
        holder.setText(R.id.item_flower_tv_time, item.createTime)
        if (getItemPosition(item) == itemCount - 2) {
            holder.getView<View>(R.id.item_flower_divider).visibility = View.GONE
        }
    }
}